About the FileMaker Admin API PKI Authentication scripts
========================================================

The included files provide an example of how to generate a
  JSON Web Token (JWT) and how to send a login request using
  FileMaker Admin API and a generated JWT.


Included files
==============
1. fmadminapi_pki_token_example.py
      This code in this file generates a valid JWT for use
      with FileMaker Admin API PKI Authentication. This code
      first generates a private and public key pair using
      the ssh-keygen command and converts the public key to
      PEM format using the openssl command. The code uses
      the following command-line commands to generate a
      private and public key pair and then converts the
      public key to the PEM format:
          First: ssh-keygen -t rsa -b 4096 -m PEM -f <Key Path>.key
          Second: openssl rsa -in <Key Path>.key -pubout -outform PEM -out <Key Path>.key.pub
      When run with the following commands, the code will
      prompt you to create a private and public key pair,
      set the expiration time for the token (the default is
      24 hours), and the name of the token; the name of the
      token must exactly match the name of the corresponding
      public key (as saved to FileMaker Server):
          Python 2: python fmadminapi_pki_token_example.py
          Python 3: python3 fmadminapi_pki_token_example.py
2. fmadminapi_pki_request_example.py
      This sample code provides an example of authenticating
      with FileMaker Admin API PKI Authentication. When run
      with the following commands, the code will prompt you
      for a JWT and will send a login request to FileMaker
      Server using FileMaker Admin API PKI Authentication:
          Python 2: python fmadminapi_pki_request_example.py
          Python 3: python3 fmadminapi_pki_request_example.py


Required Python libraries
=========================
If you use Python 3, install the required libraries using
  pip3. You can check your version of python with the
  following commands:
      Python 2: python --version
      Python 3: python3 --version
If you use Ubuntu 20, then the following required libraries
    should be installed already. However, you may also 
    manually install the packages using the following
    Ubuntu 20 commands.
The following files contain dependencies; use the command
  following the library name to install the required
  library:
      1. fmadminapi_pki_token_example.py
            jwt:
                Reference: https://pypi.org/project/PyJWT/
                Python 2: pip install pyjwt
                Python 3: pip3 install pyjwt
                Ubuntu 20: sudo apt install python3-jwt
            cryptography:
                Reference: https://pypi.org/project/cryptography/
                Python 2: pip install cryptography
                Python 3: pip3 install cryptography
                Ubuntu 20: sudo apt install python3-cryptography
      2. fmadminapi_pki_request_example.py
            requests:
                Reference: https://pypi.org/project/requests/
                Python 2: pip install requests
                Python 3: pip3 install requests
                Ubuntu 20: sudo apt install python3-requests
